import { Component } from '@angular/core';

@Component({
  selector: 'app-mobile-hot',
  templateUrl: './mobile-hot.component.html',
  styleUrls: ['./mobile-hot.component.scss']
})
export class MobileHotComponent {

  VideoList:any[]=[]

  NavData: any = []
  currentNav: string = "热门"

  changeNav(nav: any) {
    this.currentNav = nav
}
ngOnInit(){
  this.NavData=["直播", "推荐", "热门", "动画", "影视", "世界杯", "校园","新征程"]
}

constructor(){
  this.getVideoDataFromFetch();
    
}

async getVideoDataFromFetch(){
  let response = await fetch("http://metapunk.cn:9999/parse/classes/VideoHot?limit=3&order=-countLike", {
    "credentials": "omit",
    "headers": {
        "X-Parse-Application-Id": "dev",
    },
    "method": "GET",
    "mode": "cors"
})

  let data = await response.json()
  this.VideoList = data.results;
  
}

}
